package org.chen.feign;

import org.chen.common.dto.CategoryTreeDTO;
import org.chen.common.vo.ResultVO;
import org.chen.entity.CategoryInfo;
import org.chen.feign.fallback.CategoryFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "video-category" , fallback = CategoryFeignFallback.class)
public interface CategoryClient {
    
    @GetMapping("/api/category/tree")
    ResultVO<List<CategoryTreeDTO>> getCategoryTree();
    
    @GetMapping("/api/category/{id}")
    ResultVO<CategoryInfo> getCategoryById(@PathVariable("id") Long id);
    
    @PostMapping("/api/category/batch")
    ResultVO<List<CategoryInfo>> getCategoriesByIds(@RequestBody List<Long> ids);
}